//固定节点
var Test=$(".header-bar");
$(window).scroll(function (){
    scorllHeight = $(this).scrollTop()//滚动高度
    scorllLength= Test.offset().top//距离高度
    if (scorllHeight>scorllLength){
        Test.css({"position":"fixed","top":"0"})
    }
    else {
        Test.css({"position":"sticky"})
    }
})
Length= Test.offset().top//元素距离顶部高度
Length=parseInt(Length)
//设置滚动到导航
//火箭
var topdetails=document.getElementById("topRocket")
topdetails.addEventListener("click",function(){
    var timer=setInterval(function (){
        if(document.documentElement.scrollTop>Length){
            document.documentElement.scrollTop-=80;
        }
        if(document.documentElement.scrollTop<=Length){
            clearInterval(timer);
        }
    },10);
});